﻿' ----------------------------------------------------------------------
'
' NewFileSystemItem.vb
'
'   Dbfs.Entities
'
'   This class contains the fields of a FileSystemInfo object that are
'   potentially different from one layer of history to another.
'
' ----------------------------------------------------------------------
' version:  1.0.0.2
' today:    10/22/09  08:43:00
' ident:    "@(#)/Dbfs/Entities/NewFileSystemItem.vb 1.0 0.1 10/22/09 0 rjs"

Imports System.IO
Imports System.Security.AccessControl
Imports Dbfs.Security


Namespace Dbfs

    ''' <summary>
    ''' Exposes the fields and properties that are unique to a specific
    ''' historical version of a specific <see cref="FileSystemInfo"/> object.
    ''' </summary>
    ''' <remarks></remarks>
    <SerializableAttribute()> _
    Public MustInherit Class NewFileSystemItem
        Inherits FileSystemItem


#Region "Constructors"
        ''' <summary>
        ''' Initializes a new instance of the <see cref="FileSystemItem"/> class.
        ''' </summary>
        ''' <remarks></remarks>
        Public Sub New()
            MyBase.New()

            ' local variables
            Dim utcNow As Date = DateTime.UtcNow

            ' System.IO.FileSystemInfo class variables
            Attributes = FileAttributes.Normal
            CreationTimeUtc = utcNow
            LastAccessTimeUtc = utcNow
            LastWriteTimeUtc = utcNow

            ' DBFS extension variables
            EffectiveDateUtc = utcNow
            TrackChanges = False

            Exists = False

        End Sub

        ''' <summary>
        ''' Initializes a new instance of the <see cref="FileSystemItem"/> class on the specified path.
        ''' </summary>
        ''' <param name="path">A string specifying the name of the <see cref="FileSystemItem"/>.</param>
        ''' <remarks></remarks>
        Public Sub New(ByVal path As String)
            Me.New()
            ' System.IO.FileSystemInfo class variables
            Me.Name.Value = System.IO.Path.GetFileName(path)
        End Sub
#End Region

    End Class

End Namespace